import request from '@/util/request.js';

/**
 * @description 登录接口 通过code换取token并初始化用户，若用户已存在则返回用户信息
 * @param {Object} data
 */
export function getLoginApi(data) {
	return request({
		url: '/login',
		method: 'POST',
		data
	})
}
/**
 * @description 获取验证码
 * @param {Object} data
 */
export function getCaptchaApi(data) {
	return request({
		url: '/captcha',
		method: 'GET',
		data
	})
}
/**
 * @description 查询用户信息
 * @param {Object} data
 */
export function getUserInfoApi(data) {
	return request({
		url: '/getUserInfo',
		method: 'GET',
		data
	})
}
/**
 * @description 退出登录
 * @param {Object} data
 */
export function logoutApi(id) {
	return request({
		url: '/logout',
		method: 'GET',
		id
	})
}
/**
 * @description 绑定手机号
 * @param {Object} data
 */
export function bindPhoneApi(data) {
	return request({
		url: '/bindPhone',
		method: 'POST',
		data
	})
}
/**
 * @description 获取绑定手机号的验证码
 * @param {Object} data
 */
export function getBindPhoneVerifyCodeApi(data) {
	return request({
		url: '/api/common/bindTheVerificationCodeOfTheMobilePhoneNumber',
		method: 'GET',
		data
	})
}
/**
 * @description 验证绑定手机号
 * @param {Object} data
 */
export function verifyBindPhoneApi(data) {
	return request({
		url: '/api/common/verifyTheBoundMobilePhoneNumber',
		method: 'POST',
		data
	})
}